<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<base href="<%=basePath%>" />
<jsp:include page="/jsp/common.jsp" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>resource/css/order.css" />
<script type="text/javascript">
$().ready(function(){
	$("#address_selecter li").bind("click", function(){
		$("#address_selecter li.selected").removeClass("selected");
		$(this).addClass("selected");
	});

});
</script>
</head>
<body>
<jsp:include page="../header.jsp" />
<div class="content">
<div class="bar">
	<div class="title title_info">
		<ul>
			<li>查看购物车</li>
			<li class="current">订单信息</li>
			<li>完成订单</li>
		</ul>
	</div>
	<div class="info">
	<form id="newForm" action="<%=basePath %>user/order_new.do">
		<c:forEach var="pId" items="${product_id}">
			<input name="product_id" type="hidden" value="${pId }" />
		</c:forEach>
		<c:forEach var="pCount" items="${product_count}">
			<input name="product_count" type="hidden" value="${pCount }" />
		</c:forEach>
		<input name="total" type="hidden" value="${total }" />
		<input name="receiver_id" type="hidden" value="1" />
		<div class="receiver">
			<div class="th">收货地址</div>
			<ul id="address_selecter">
			<c:forEach var="receiver" items="${receiverList}">
				<li class='${receiver.is_default == 1 ? "selected" : "" }'>
					<div>
						<strong>${receiver.contact }</strong>收
					</div>
					<div>
						<span>${receiver.address }</span>
					</div>
					<div>${receiver.tel }</div>
					<em class="edit"><a href="javascript:;">修改</a></em>
				</li>
			</c:forEach>
			</ul>
			<div class="newaddr">
				<a id="newaddr" href="javascript:;">新增收货地址</a>
			</div>
		</div>
		<div class="payment">
			<div class="th">支付方式</div>
		</div>
		<div class="shipping">
			<div class="th">配送方式</div>
		</div>
		<input type="submit" value="提交"/>
	</form>
	</div>
	<div class="bottom">
		<a href="javascript:;" class="clear">清空购物车</a>
		<a href="<%=basePath %>jsp/order/payment.jsp" class="submit">提交订单</a>
	</div>
</div>
</div>
<jsp:include page="../footer.jsp" />
</body>
</html>